<?php
/**
 * @author Brian Voss
 */
class GoogleController extends Social_Oauth_BaseController {
	/**
	 * @var String 
	 */
	protected $serviceKey = 'google';
	/**
	 * Initialization 
	 */
	public function init()
	{
		parent::init();
	}
	/**
	 * Default Page 
	 */
	public function indexAction()
	{
		$authenticated = $this->isAuthenticated();
		echo $authenticated ? "logged in" : "not logged in";
	}
	/**
	 * Start authentication 
	 */
	public function startauthAction()
	{
		$scope = array(
			"scope" => implode(" ", $this->config->oauth->scopes->toArray() )
		);
		parent::startauth($scope);
	}
	/**
	 * Complete authentication
	 */
	public function finishauthAction()
	{
		parent::finishauth();
		if ( $this->isAuthenticated() )
		{
			echo "worked!";
		}
		else
		{
			echo "didn't work";
		}
	}
	/**
	 * Cancel Authentication 
	 */
	public function cancelauthAction()
	{
		// TODO
	}
}